$('#button').click(function() {
    // Get all the forms elements and their values in one step
    var account = $("#account option:selected").val();
    var description = $("#description").val();  
    var value = $("#value").val();
    var category = new Array();
    var kids = $("#log").children();
    kids.each(function(index,cont) {
    category[index] = $(this).children().attr('id');
    });
    alert($.toJSON(category));
    $.ajax({
      type: "GET",
      url:  "/apps/script/add_transaction.php",  
      data: "account="+account+"&description="+description+"&value="+value+"&action=ADD&category="+category,
      success: function(msg){
      if(msg != '')
        alert( msg);
        else{
          alert("transaction added");
        }
      },
      error: function(xhr, ajaxOptions, thrownError){
        alert(xhr.status);
        alert(xhr.statusText);
        alert(thrownError);
      }
       });
    


});


	
	
	
	
	
	
	
	

$(document).ready(function(){

      
  
	// If we click anywhere on the page, while the
	// dropdown is shown, it is going to be hidden:

  
   $(document).click(function(){
      


	});
})